<?php 
/**
 * 工具类
 * @author prettyyjnic <prettyyjnic@qq.com> 20151101
 */
class Yjnic_Utils {

    /**
     * 生成mvc的URL
     */
    static function U($app_name, $controller, $action = 'index', $params=array()){
        $url = $app_name.'.php?r=' . $controller .'.' . $action;
        if (!empty($params) ) {
            $url .= http_build_query($params);
        }
        return $url;
    }

    /**
     * 生成服务的URL
     */
    static function SU($app_name, $controller, $action = 'lists', $params=array()){
        $url = $app_name.'.php?service=' . $controller .'.' . $action;
        if (!empty($params) ) {
            $url .= http_build_query($params);
        }
        return $url;
    }
}
